<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:72:"D:\phpStudy\WWW\tp7cai\public/../application/admin\view\login\index.html";i:1499669940;s:74:"D:\phpStudy\WWW\tp7cai\public/../application/admin\view\public\header.html";i:1499669940;s:74:"D:\phpStudy\WWW\tp7cai\public/../application/admin\view\public\footer.html";i:1499669940;}*/ ?>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title> 后台中心</title>
	<link rel="stylesheet" href="/admin/basic/css/pintuer.css">
    <link rel="stylesheet" href="/admin/basic/css/admin.css">
    <script src="/js/jquery-3.1.1.min.js"></script>
    <script src="/admin/basic/js/pintuer.js"></script>
	<script src="/js/layer/layer.js"></script>
	<script src="/js/my.js"></script>
	  
</head>

<body>
<div class="bg"></div>
<div class="container">
    <div class="line bouncein">
        <div class="xs6 xm4 xs3-move xm4-move">
            <div style="height:150px;"></div>
            <div class="media media-y margin-big-bottom">
            </div>
            <form id="form" action="" method="post">
                <div class="panel loginbox">
                    <div class="text-center margin-big padding-big-top"><h1>后台登录</h1></div>
                    <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
                        <div class="form-group">
                            <div class="field field-icon-right">

                                <input type="text" class="input input-big" name="name" placeholder="请输入账号" data-validate="请输入账号" />
                                <span class="icon icon-user margin-small"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="field field-icon-right">

                                <input type="password" class="input input-big" name="pwd" placeholder="请输入密码" data-validate="请输入密码" />
                                <span class="icon icon-key margin-small"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="field">

                                <input type="text" class="input input-big" name="code" placeholder="请输入验证码" data-validate="请输入验证码" />
                                <img id="code_img" src="<?php echo U('login/verify'); ?>" alt="" width="100" height="32" class="passcode" style="height:43px;cursor:pointer;" onclick="this.src='<?php echo U('login/verify'); ?>?t='+new Date().getTime()">

                            </div>
                        </div>
                    </div>

                    <div style="padding:30px;"><a type="button"   onclick="  submit();" class="button button-block bg-main text-big input-big"  value="登录" >登录</a> </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    function submit(){
        var formdata=new FormData($("#form")[0]);
        $.ajax({
            type:"post",
            url:"<?php echo U('login/login'); ?>",
            data:formdata,
            dataType:"json",
            processData:false,
            contentType:false,
            cache:false,
            success:function(rs){
                layer.msg(rs.msg);
                changeCode();
                if(rs.res==1 && rs.data.url !=undefined){
                    window.location=rs.data.url;
                }

            }
        });
    }
    function changeCode(){
        var url="<?php echo U('login/verify'); ?>?t="+new Date().getTime()
        $("#code_img").attr("src",url);
    }

</script>
</body>
</html>